const outside_path = 'search/outside_video'

export function genOutsideVideoURL(videoPath) {
    // 生成视频文件的完整 URL
    const res = `${import.meta.env.VITE_API_URL}/${outside_path}/${encodeURIComponent(videoPath)}`;
    return res;
}

export function getOriginOutsideVideoURL(videoPath) {
    // 去掉前缀，返回原始路径
    const prefix = `${import.meta.env.VITE_API_URL}/${outside_path}/`;
    if (videoPath.startsWith(prefix)) {
        return decodeURIComponent(videoPath.slice(prefix.length));
    }
    return videoPath;
}